﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZSZ.Service.Entity;

namespace ZSZ.Service.EntityConfig
{
    class PermissionConfig: EntityTypeConfiguration<PermissionEntity>
    {
        public PermissionConfig() {
            this.ToTable("T_Permission");
            HasMany(p => p.Roles).WithMany(r => r.Permissions).Map(m=>m.ToTable("T_RolesAndPermission").MapLeftKey("PermissionId").MapRightKey("RoleId"));
        }
    }
}
